const _swan = require("../../__antmove/__antmove_baidu/api/index.js")(swan);
const _Page = require("../../__antmove/component/componentClass.js")("Page");

function _next() {
    var that = this;

    if (this.data.progress >= 100) {
        this.setData({
            disabled: false
        });
        return true;
    }

    this.setData({
        progress: ++this.data.progress
    });
    setTimeout(function() {
        _next.call(that);
    }, 20);
}

_Page({
    data: {
        progress: 0,
        disabled: false
    },
    upload: function() {
        if (this.data.disabled) return;
        this.setData({
            progress: 0,
            disabled: true
        });

        _next.call(this);
    }
});
